import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import service from "./utils/service";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';


import {checkbox,SubmitBar,SwipeCell,tag,Divider,Empty,Card,DropdownMenu,DropdownItem,Search,GoodsAction,GoodsActionButton,GoodsActionIcon,Popup,Cascader,Swipe,SwipeItem,Icon,List,Cell,NavBar,Button,Field,CellGroup,CountDown,SidebarItem,Sidebar,Grid,GridItem,Image as VanImage,Toast} from 'vant';
Vue.use(List);
Vue.use(Icon );
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
Vue.use(Button);
Vue.use(Field);
Vue.use(CountDown);
Vue.use(SidebarItem);
Vue.use(Sidebar);
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(VanImage);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Cascader);
Vue.use(Popup);
Vue.use(GoodsAction);
Vue.use(GoodsActionButton);
Vue.use(GoodsActionIcon);
Vue.use(Search);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Card);
Vue.use(Toast);
Vue.use(Popup);
Vue.use(Empty);
Vue.use(Divider);
Vue.use(tag);
Vue.use(SwipeCell);
Vue.use(SubmitBar);
Vue.use(checkbox);



Vue.config.productionTip = false

Vue.use(ElementUI);


// import axios from 'axios'
// axios.defaults.baseURL='http://localhost:3001'
// Vue.prototype.$https =axios

Vue.prototype.$service = service;


//解决路由冗余
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单跳转当前页面报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
